package com.drm.netschool.mapper;

import com.drm.netschool.entity.SumerSharedFile;
import com.drm.netschool.entity.SumerSharedFileExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SumerSharedFileMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int countByExample(SumerSharedFileExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int deleteByExample(SumerSharedFileExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Delete({
        "delete from sumer_shared_file",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Insert({
        "insert into sumer_shared_file (id, name, ",
        "file_id, create_time, ",
        "file_type, resource_id, ",
        "file_size)",
        "values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
        "#{fileId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{fileType,jdbcType=VARCHAR}, #{resourceId,jdbcType=BIGINT}, ",
        "#{fileSize,jdbcType=BIGINT})"
    })
    int insert(SumerSharedFile record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int insertSelective(SumerSharedFile record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    List<SumerSharedFile> selectByExample(SumerSharedFileExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Select({
        "select",
        "id, name, file_id, create_time, file_type, resource_id, file_size",
        "from sumer_shared_file",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    SumerSharedFile selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int updateByExampleSelective(@Param("record") SumerSharedFile record, @Param("example") SumerSharedFileExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int updateByExample(@Param("record") SumerSharedFile record, @Param("example") SumerSharedFileExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int updateByPrimaryKeySelective(SumerSharedFile record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_shared_file
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Update({
        "update sumer_shared_file",
        "set name = #{name,jdbcType=VARCHAR},",
          "file_id = #{fileId,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "file_type = #{fileType,jdbcType=VARCHAR},",
          "resource_id = #{resourceId,jdbcType=BIGINT},",
          "file_size = #{fileSize,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(SumerSharedFile record);
}